Repository navigation
feat: add the ai-queue-worker service [ENG-2181] - #40
Conversation
On-prem webhooks no longer runs AI tasks. The new ai-queue-worker service consumes the ai-bmq queue; without it, AI explanations and chat stop. - Service in compose.currents.yml, same image repository and tag as the other services, same .env. Redis and MongoDB dependencies and the RustFS path-style setting are copied from webhooks. Compose files regenerated. - .env.example and the configuration reference list the LLM_* settings. - Docs: services list, ECR policy and image mirroring lists, changelog upgrade notes. The image exists only in the Currents release that contains currents-dev/currents#4874. Release this with that image tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011baD3izoabUn31Y3WeQHMp
|
| Topic | Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| AI Deployment Guidance | Explain the upgrade impact and add the worker image to ECR access and mirroring workflows, including guidance that existing AI users must explicitly enable the new service.Modified files (3)
Latest Contributors(2)
| |||||||||
| On-Prem AI Worker | Add the profile-gated ai-queue-worker service to all on-prem Compose variants, configure MongoDB, Redis, and RustFS integration, and document enabling it alongside AI_QUEUE_WORKER_ENABLED and LLM settings.Modified files (9)
Latest Contributors(2)
|
Merger ✅ Ready to Merge
MERGE: the new AI queue worker and its enablement/documentation are present, CI ran, and all review discussions are settled.
twk3
left a comment
There was a problem hiding this comment.
Ran this locally on images built from main 6f87424c7 (includes currents-dev/currents#4874), full compose file, with USE_MOCK_AI=true. The worker starts and webhooks no longer takes AI tasks. testSidebarAiAnalysis.spec.ts passed with its GraphQL stub removed: both requests in aiRequests completed, and only ai-queue-worker logged them.
One change requested: put the service behind a Compose profile so it is off by default for now. AI is already off per org until features.aiAnalysis is set, and the worker needs LLM_* settings to do anything, so most installs would run an idle container and have to pull and mirror an image they don't use. With a profile, docker compose pull and up skip it unless COMPOSE_PROFILES includes ai. traefik already does this with tls. Comments inline.
Baz withdrew its approval because this pull request is no longer ready to merge.
The worker needs an LLM endpoint the admin provides, and the docs do not yet say what AI does with it or what it costs (ENG-2209). It now sits in an `ai` profile, as traefik sits in `tls`, and starts only with COMPOSE_PROFILES=ai in .env. The changelog also said the director reads AI_QUEUE_WORKER_ENABLED to create the AI indexes. The director builds indexes only with CREATE_MONGO_INDEX, which no compose file sets; the scheduler builds them, and reads the variable from the same .env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The TLS instructions run `docker compose --profile tls up`, and a --profile flag replaces COMPOSE_PROFILES. A TLS user who sets COMPOSE_PROFILES=tls,ai and keeps the flag gets Traefik but no ai-queue-worker, and AI requests wait in ai-bmq. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing ai from COMPOSE_PROFILES and running docker compose up -d leaves the worker running with its old settings; --remove-orphans does not remove it either. docker compose rm -sf ai-queue-worker does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 1. Default
2. Worker on, following I uncommented
3. TLS With
4. Turning it off
Not covered:
|
Baz withdrew its approval because this pull request is no longer ready to merge.
Owner: @agoldis
Linear: ENG-2181
Adds the
ai-queue-workerservice, off by default in anaiprofile. On-premwebhooksno longer runs AI tasks after the Currents release that contains currents-dev/currents#4874, so an install that uses AI needs this service turned on.This must ship with, not before, the Currents release that contains currents-dev/currents#4874. The image
ai-queue-workerdoes not exist before then, sodocker compose pullfails for the new service on any earlier tag. Merge it into the release that setsDC_CURRENTS_IMAGE_TAGto that tag.Changes
templates/compose.currents.yml: serviceai-queue-worker, image${DC_CURRENTS_IMAGE_REPOSITORY}ai-queue-worker:${DC_CURRENTS_IMAGE_TAG}, built likewebhooks(env_file: .env,CURRENTS_ENV: onprem, no ports, no command override).aiprofile, astraefikis intls, and starts only withCOMPOSE_PROFILES=aiin.env. It needs an LLM endpoint the admin provides. The docs don't yet say what AI features an admin gets, how we use their provider, or what it costs (ENG-2209). AI is also off on-prem until an org admin grants consent.AI_QUEUE_WORKER_ENABLED=truein.env, so the scheduler builds the AI collections' MongoDB indexes, including the TTLs that expire AI sessions. The director builds indexes only withCREATE_MONGO_INDEX, which no compose file sets.depends_on, and the RustFSFILE_STORAGE_FORCE_PATH_STYLE, are copied fromwebhooksin the three data-service templates.scripts/sync-templates.sh..env.exampleanddocs/configuration.md: how to turn the worker on (COMPOSE_PROFILES=ai,AI_QUEUE_WORKER_ENABLED=true), and theLLM_*andAI_QUEUE_CONCURRENCYsettings. No new required variable.docs/container-images.md: ECR policy and both image-mirroring lists.on-prem/README.md: services list.on-prem/CHANGELOG.md: Unreleased entries with the upgrade notes below.webhooksand the director are unchanged. No compose file setsAI_QUEUE_WORKER_ENABLED.VERSIONor image tag change; the release PR does that.Upgrade notes for on-prem customers
COMPOSE_PROFILES=aito.env, and keepAI_QUEUE_WORKER_ENABLED=trueand yourLLM_PROVIDER_URL/LLM_API_KEY.currents/on-prem/ai-queue-workerrepository to your ECR policy and mirror the image with the others.webhooks,AI_QUEUE_WORKER_ENABLED=truenow only starts the Slack AI answer worker, and only whenSLACK_AI_CALLBACK_WORKER_ENABLEDis unset.Checked
docker compose config --quieton all three files with the validate workflow's minimal.env: valid.config --servicesleaves outai-queue-workerby default and includes it withCOMPOSE_PROFILES=ai; withtls,aiit includestraefiktoo.scripts/sync-templates.shwas run after the profile change.docker compose -f docker-compose.{full,database,cache}.yml config --quietwith a minimal.env, as the validate workflow does: all three pass.scripts/sync-templates.sh: the committed files match the templates.Not run: the Podman validation, and the smoke test (it starts only
schedulerandapi, so it does not start the new service).Checklist
(fix|feat|chore): title [CSR-xxx]🤖 Generated with Claude Code
https://claude.ai/code/session_011baD3izoabUn31Y3WeQHMp